#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;cin>>n;
	unordered_map<string,int> ren(n);
	while(n--){
		string r;
		cin>>r;
		if(!ren[r]){
			ren[r]=1;
			cout<<"Hello "<<r<<", how are you?";
		}
		else{
			cout<<"Hi "<<r<<"! Glad to see you again!";
		}
		cout<<endl;
	}
	return 0;
}